package com.laguille.games.monopoly.commons.player;

import java.util.Set;

import com.laguille.games.monopoly.commons.property.Property;

public interface Player {

	/**
	 * Returns a player name.
	 * @return the name
	 */
	String getName();

	/**
	 * Returns a player owned properties.
	 * @return the properties
	 */
	Set<Property> getPropertySet();

	/**
	 * Returns a player cash.
	 * @return the cash
	 */
	int getCash();

	/**
	 * Withdraws cash from the player account.
	 * @param amount the amount to withdraw.
	 */
	void withdrawCash(int amount);

	/**
	 * Deposits cash into the player account.
	 * @param amount the amount to deposit.
	 */
	void depositCash(int amount);
	
	/**
	 * Tries to buy a property. 
	 * Returns false if the transaction fails because of lack of cash.
	 * @param property the property to purchase
	 * @return true if the transaction is validated, false otherwise
	 */
	boolean buyProperty(Property property);

	/**
	 * Tries to withdraw an <code>amount</code> of cash for the player.
	 * Returns false if the transaction fails because of lack of cash. 
	 * @param amount the amount to withdraw
	 * @return	true if the cash was withdrawn, false if it fails.
	 */
}
